package com.code.base.sys.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.sys.persistence.SysRoleMapper;
import com.code.base.sys.pojo.SysRole;
import com.code.util.PrimaryKeyUtil;


@Service
public class SysRoleService {


	@Resource
	private SysRoleMapper sysRoleMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public SysRole getDataById(Long id) {
		return sysRoleMapper.getDataById(id);
	}

	public List<SysRole> getAllData() {
		return sysRoleMapper.getAllData();
	}

	public int getDataCountByCondition(SysRole entity) {
		return sysRoleMapper.getDataCountByCondition(entity);
	}

	public List<SysRole> getDataByCondition(SysRole entity) {
		return sysRoleMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(SysRole entity) {
		return sysRoleMapper.getDataCountByLikeCondition(entity);
	}

	public List<SysRole> getDataByLikeCondition(SysRole entity) {
		return sysRoleMapper.getDataByLikeCondition(entity);
	}

	public List<SysRole> getDataByIds(Long[] ids) {
		return sysRoleMapper.getDataByIds(ids);
	}

	public void insertData(SysRole entity) {
		insertData(entity, true);
	}

	public void insertData(SysRole entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		sysRoleMapper.insertData(entity);
	}

	public void updateData(SysRole entity) {
		sysRoleMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		sysRoleMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(SysRole entity) {
		sysRoleMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		sysRoleMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		sysRoleMapper.deleteDataByIds(ids);
	}

}
